package com.nice.demo.test;//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//


import android.graphics.Bitmap;

import java.util.HashMap;
import java.util.WeakHashMap;

public class HandWritingViewCache implements IHandWritingViewCache {
    static String TAG = "HandWritingViewCache";
    static HashMap<String, Float> stringFloatHashMap = new HashMap();
    static WeakHashMap<String, Bitmap> stringBitmapHashMap = new WeakHashMap();
    static HashMap<String, Integer> integerHashMap = new HashMap();

    public HandWritingViewCache() {
    }

    public static float parseFloat(String floatStr) {
        Float value = (Float)stringFloatHashMap.get(floatStr);
        if (value == null) {
            value = Float.valueOf(floatStr);
            stringFloatHashMap.put(floatStr, value);
        }

        return value;
    }

    public static int parseInt(String intStr) {
        Integer value = (Integer)integerHashMap.get(intStr);
        if (value == null) {
            value = Integer.parseInt(intStr);
            integerHashMap.put(intStr, value);
        }

        return value;
    }

    public Bitmap getCacheBitmap(String key) {
        Bitmap bitmap = (Bitmap)stringBitmapHashMap.get(key);
        return bitmap;
    }

    public void putCacheBitmap(String key, Bitmap bitmap) {
        stringBitmapHashMap.put(key, bitmap);
    }
}
